//
//  I_Brand.m
//  YunDongAdmin
//
//  Created by lqq on 2018/9/12.
//  Copyright © 2018年 cloudfighting.com. All rights reserved.
//

#import "I_Brand.h"

@implementation I_Brand
/**
 获取品牌
 */
+ (NetworkTask *)getBrandOnSuccess:(void(^)(M_Brand *brand))successBlock failure:(ErrorBlock)failureBlock
{
    return [NET POST:@"/gym-coach-api/admin/1.0.0/getBrand" parameters:nil criticalValue:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nonnull resultObject) {
        if (successBlock) {
            M_Brand *brand = [[M_Brand alloc] initWithDictionary:SAFE_VALUE_FOR_KEY(resultObject, @"data") error:nil];
            successBlock(brand);
        }
    } failure:^(NSURLSessionDataTask * _Nonnull task, NSError * _Nonnull error) {
        if (failureBlock) {
            failureBlock(error);
        }
    }];
}


/**
 设置品牌
 */
+ (NetworkTask *)editBrandWithParams:(NSDictionary *)params
                             success:(void(^)(M_Brand *brand))successBlock
                             failure:(ErrorBlock)failureBlock
{
    return [NET POST:@"/gym-coach-api/admin/1.0.0/setBrand" parameters:params criticalValue:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nonnull resultObject) {
        if (successBlock) {
            M_Brand *brand = [[M_Brand alloc] initWithDictionary:SAFE_VALUE_FOR_KEY(resultObject, @"data") error:nil];
            successBlock(brand);
        }
    } failure:^(NSURLSessionDataTask * _Nonnull task, NSError * _Nonnull error) {
        if (failureBlock) {
            failureBlock(error);
        }
    }];
}
@end
